<template>
    <div class="m-button" @click="cs = 9">
      <lb-button :cs="cs" @hook:mounted="ChildCreated"></lb-button>
      <el-tooltip class="item" effect="light" content="Top Left 提示文字" placement="top-start">
        <el-button >上左</el-button>
      </el-tooltip>
      {{ arr[0] }}
      <!--<lb-button></lb-button>-->
      <!--<img src="../../assets/image/1.png" onload="alert(222)"/>-->
      <!--<a href="javascript:alert(11);">adsad</a>-->
      <!--<lb-button></lb-button>-->
      <!--<img src="../../assets/image/1.png" onload="alert(222)"/>
      <a href="javascript:alert(11);">adsad</a>-->
    </div>
</template>
<style lang="less" scoped>
  .m-button {
    height: 100%;
    box-sizing: border-box;
    padding: 60px 0 0 60px;
    font-size: 14px;
  }
</style>
<script>
  import LbButton from '../../components/button/button.vue'
  import { toggleObserving, shouldObserve } from '../cs'
  export default {
    name: 'm-button',
    data () {
      return {
        cs: 2,
        arr: [1]
      }
    },
    components: {
      LbButton
    },
    methods: {
      ChildCreated () {
        this.arr[0] = 2
        //console.log(222)
      }
    },
    mounted () {
      //console.log(6666)
      /*new Promise((resolve,reject) => {
        setTimeout(() => {
          resolve(555)
        },1000)
      }).then(() => {
        let  mm = 0;
        return new Promise((resolve,reject) => {
          setTimeout(() => {
            console.log(666)
            resolve(mm = 5,99)
          },2000)
        })
      }).then((res) => {
        console.log(...res)
        console.log(222)
      })*/
      /*let aa = [{a:1}];
      let bb = aa.map((obj) => {
        return Object.assign({},obj)
      })
      bb[0].a = 2;
      console.log(aa)*/
      //console.log(shouldObserve)
      'mm-ddd-vvv'.replace(/-(\w)/g, (_, c, b, d, v) => {
        console.log(_)
        console.log(c)
        console.log(b)
        console.log(d)
        console.log(v)
        return c ? c.toUpperCase() : ''
      })
      console.log('>'.match(/^\s*(\/?)>/))
    }
  }
</script>
